package com.yulang.common.pojo.goods;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * <p>
 * 
 * </p>
 *
 * @author Administrator
 * @since 2019-12-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_para")
public class Para implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = ID, type = IdType.AUTO)
    private Integer id;

    /**
     * 名称
     */
    @TableField(NAME)
    private String name;

    /**
     * 选项
     */
    @TableField(OPTIONS)
    private String options;

    /**
     * 排序
     */
    @TableField(SEQ)
    private Integer seq;

    /**
     * 模板ID
     */
    @TableField(TEMPLATE_ID)
    private Integer templateId;


    public static final String ID = "`id`";

    public static final String NAME = "`name`";

    public static final String OPTIONS = "`options`";

    public static final String SEQ = "`seq`";

    public static final String TEMPLATE_ID = "`template_id`";


    public static final String ID_COMMENT = "id";

    public static final String NAME_COMMENT = "名称";

    public static final String OPTIONS_COMMENT = "选项";

    public static final String SEQ_COMMENT = "排序";

    public static final String TEMPLATE_ID_COMMENT = "模板ID";



    public static Para of(Object obj) {
        Para e = new Para();
        BeanUtils.copyProperties(obj, e);
        return e;
    }

    public static QueryWrapper<Para> queryWrapper(Object obj) {
        return new QueryWrapper<>(of(obj));
    }

}
